package cn.edu.my.test.event;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.JButton;
import javax.swing.JFrame;

public class EventThrouthAdapter extends JFrame {

	private static final long serialVersionUID = 2294109063186798144L;
	private JButton jb;
	
    public EventThrouthAdapter() {
        jb = new JButton("ȷ��");
        
		//�¼�������
		/*jb.addMouseListener(new MouseAdapter() {
            public void mouseClicked(MouseEvent e) {
                jb.setText("�¼���Ӧ��");
            }
        });*/
		
		//�����ڲ���
		jb.addMouseListener(new MouseListener() {
            public void mouseClicked(MouseEvent e) {
                jb.setText("�¼���Ӧ��");
            }

            public void mouseEntered(MouseEvent e) {
            }

            public void mouseExited(MouseEvent e) {
            }

            public void mousePressed(MouseEvent e) {
            }

            public void mouseReleased(MouseEvent e) {
            }
        });
		
        this.add(jb);
        this.setSize(300, 200);
        this.setDefaultCloseOperation(3);
        this.setVisible(true);
    }

    public static void main(String[] args) {
        new EventThrouthAdapter();
    }
}
